import service from '@/utils/request';

// 分页查询工具列表
export const getTool = params =>
  service({
    url: '/simulation/research/tool/',
    method: 'get',
    params,
  });

// 工具详情
export const detailTool = id =>
  service({
    url: `/simulation/research/tool/${id}/`,
    method: 'get',
  });

// 工具详情
export const editTool = (id, data) =>
  service({
    url: `/simulation/research/tool/${id}/`,
    method: 'put',
    data,
  });

// 删除工具
export const delTool = id =>
  service({
    url: `/simulation/research/tool/${id}/`,
    method: 'delete',
  });

// 创建工具
export const createTool = data =>
  service({
    url: '/simulation/research/tool/',
    method: 'post',
    data,
  });

// 升级工具
export const toolUpgrade = (id, data) =>
  service({
    url: `/simulation/research/tool/upgrade/${id}/`,
    method: 'post',
    data,
  });

// 调试工具
export const toolDebug = (id, data) =>
  service({
    url: `/simulation/research/tool/${id}/debug/`,
    method: 'post',
    data,
  });

// 调试工具
export const toolStopDebug = id =>
  service({
    url: `/simulation/research/tool/${id}/stopDebug/`,
    method: 'get',
  });

// 工具实例信息
export const toolInstanceDetail = (id,toolInstanceID) =>
    service({
        url: `/simulation/research/tool/${id}/instance/${toolInstanceID}/`,
        method: 'get',
    });

// 工具调试信息
export const toolDebugDetail = (id,toolInstanceID) =>
  service({
    url: `/simulation/research/tool/${id}/debug/${toolInstanceID}/`,
    method: 'get',
  });

// 工具调试信息
export const toolDebugResult = (id, params) =>
  service({
    url: `/simulation/research/tool/${id}/debugResult/`,
    method: 'get',
    params,
  });

// 查询工具分类
export const getToolOption = params =>
  service({
    url: '/simulation/research/tool/options/',
    method: 'get',
    params,
  });

// 分页查询工具实例列表
export const getToolInstance = data =>
  service({
    url: '/simulation/research/tool/instance/',
    method: 'get',
    params: data,
  });

// 删除工具实例
export const delToolInstance = id =>
  service({
    url: `/simulation/research/tool/instance/${id}/`,
    method: 'delete',
  });

// 工具任务信息
export const getToolTaskDetail = id =>
  service({
    url: `/simulation/research/task/${id}/`,
    method: 'get',
  });
